{% comment %}
 Copyright © 2010 Benedikt Eger

 This file is part of top-news-buzz.

 top-news-buzz is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 top-news-buzz is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with top-news-buzz.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
<h2>Metric Configuration</h2>
<form action="" method="post" >
{% for metric in metrics %}
<div class="metric">
<h3>{{ metric.display_name }}</h3>
	{% for config_entry in metric.config %}		
		{% ifequal config_entry.input_type MetricConfigEntry.INPUT_TYPE_TEXT %}
		{{ config_entry.title }}<br/>
		<input type="text" value="{{ config_entry.value }}" name="{{ config_entry.parameter_name }}" /> 
		{% endifequal %}
		{% ifequal config_entry.input_type MetricConfigEntry.INPUT_TYPE_RADIO %}
		{{ config_entry.title }}&#160;&#160;&#160;<input type="radio" name="{{ config_entry.parameter_name }}" {% ifequal config_entry.value 'True' %}checked="checked" {% endifequal %}value="True"/> Yes&#160;&#160;<input type="radio" name="{{ config_entry.parameter_name }}" {% ifequal config_entry.value 'False' %}checked="checked" {% endifequal %}value="False"/> No
		{% endifequal %}
		<br/>
		<small>{{ config_entry.description }}</small><br/><br/>
	{% endfor %}
</div>
{% endfor %}
<div class="clear" />
<input type="submit" value="Update metric configuration" />
</form>